* Table 2.1

ttest IMF if gdpcap2000_sup<5000 & year==2003, by  (oil_gas_value100)
ttest IMF if gdpcap2000_sup>5000  & year==2003, by  (oil_gas_value100)
ttest IMF if year==2003, by  (oil_gas_value100)

* Table 2.2

ttest tax_goods if year==2002 & gdpcap2000_sup<5000, by  (oil_gas_value100)
ttest tax_goods if year==2002 & gdpcap2000_sup>5000, by  (oil_gas_value100)
ttest tax_goods if year==2002, by  (oil_gas_value100)

* Table 3.1

ttest ttd_SD, by  (oil_gas_value100)
ttest ttd_SD if gdpcap2000_sup<5000, by  (oil_gas_value100)
ttest ttd_SD if gdpcap2000_sup>5000, by  (oil_gas_value100)
ttest ttd_SD if year<1980, by  (oil_gas_value100)
ttest ttd_SD if year>1979, by  (oil_gas_value100)
ttest ttd_SD if latin>.5, by (oil_gas_value100)
ttest ttd_SD if latin<.5, by (oil_gas_value100)

* Table 3.3

ranksum budget_open08, by(oil_gas_value100_2006)
ranksum budget_open08 if democracy==1, by(oil_gas_value100_2006)
ranksum budget_open08 if democracy==0, by(oil_gas_value100_2006)

sum budget_open08 if oil_gas_value100_2006==1
sum budget_open08 if oil_gas_value100_2006==0
sum budget_open08 if democracy==1 & oil_gas_value100_2006==0
sum budget_open08 if democracy==1 & oil_gas_value100_2006==1
sum budget_open08 if democracy==0 & oil_gas_value100_2006==0
sum budget_open08 if democracy==0 & oil_gas_value100_2006==1

* Table 3.4
 
ttest press_freedom if year==2006, by (oil_gas_value100)
ttest press_freedom if year==2005 & gdpcap2000_sup<5000, by (oil_gas_value100)
ttest press_freedom if year==2005 & gdpcap2000_sup>5000, by (oil_gas_value100)
ttest press_freedom if year==2006 & democracy_update==1, by (oil_gas_value100)
ttest press_freedom if year==2006 & democracy_update==0, by (oil_gas_value100)

* Table 3.5

ranksum rev_data if year==2006, by (oil_gas_value100)
ranksum Govt_cons_data if year==2006, by (oil_gas_value100)

sum rev_data if year==2006 & oil_gas_value100==0
sum rev_data if year==2006 & oil_gas_value100==1
sum Govt_cons_data if year==2006 & oil_gas_value100==0
sum Govt_cons_data if year==2006 & oil_gas_value100==1

* Table 3.6

ttest tta_SD, by  (oil_gas_value100)
ttest tta_SD if gdpcap2000_sup<5000, by (oil_gas_value100)
ttest tta_SD if gdpcap2000_sup>5000, by (oil_gas_value100)
ttest tta_SD if year<1980, by  (oil_gas_value100)
ttest tta_SD if year>1979, by  (oil_gas_value100)
ttest tta_SD if year>1979 & gdpcap2000_sup<5000, by (oil_gas_value100)

* Table 3.7 

*Column 1: controls only
xtlogit dem_transition logGDP_cap2000_sup_1 ///
log_authyrs_1 YEAR1960_64 YEAR1965_69 YEAR1970_74 YEAR1975_79 ///
YEAR1980_84 YEAR1985_89 YEAR1990_94 ///
YEAR1995_99 YEAR2000_04 YEAR2005_09, nolog

*Column 2: adding oil
xtlogit dem_transition logGDP_cap2000_sup_1 ///
log_authyrs_1 logoil_gas_valuePOP_1 YEAR1960_64 ///
YEAR1965_69 YEAR1970_74 YEAR1975_79 ///
YEAR1980_84 YEAR1985_89 YEAR1990_94 ///
YEAR1995_99 YEAR2000_04 YEAR2005_09, nolog

*Column 3: 1960-79 only
xtlogit dem_transition logGDP_cap2000_sup_1 ///
log_authyrs_1 logoil_gas_valuePOP_1 YEAR1960_64 ///
YEAR1965_69 YEAR1970_74 YEAR1975_79 ///
YEAR1980_84 YEAR1985_89 YEAR1990_94 ///
YEAR1995_99 YEAR2000_04 YEAR2005_09 ///
if year<1980, nolog

*Column 4: 1980-2006 only
xtlogit dem_transition logGDP_cap2000_sup_1 ///
log_authyrs_1 logoil_gas_valuePOP_1 YEAR1960_64 ///
YEAR1965_69 YEAR1970_74 YEAR1975_79 ///
YEAR1980_84 YEAR1985_89 YEAR1990_94 ///
YEAR1995_99 YEAR2000_04 YEAR2005_09 ///
if year>1979, nolog

*Column 5: adding Latin America*oil
xtlogit dem_transition logGDP_cap2000_sup_1 ///
log_authyrs_1 logoil_gas_valuePOP_1 latin_logoil_1 YEAR1960_64 ///
YEAR1965_69 YEAR1970_74 YEAR1975_79 ///
YEAR1980_84 YEAR1985_89 YEAR1990_94 ///
YEAR1995_99 YEAR2000_04 YEAR2005_09, nolog

*Column 6: further controls
xtlogit dem_transition logGDP_cap2000_sup_1 ///
log_authyrs_1 logoil_gas_valuePOP_1 latin_logoil_1 ///
dem_prior_update gdpgrowth_alt_new_1 mus_pct_sup_1 ///
YEAR1960_64 YEAR1965_69 YEAR1970_74 YEAR1975_79 ///
YEAR1980_84 YEAR1985_89 YEAR1990_94 ///
YEAR1995_99 YEAR2000_04 YEAR2005_09, nolog


* Table 3.8

*Column 1: controls only
xtregar polity polity_5 logGDP_cap2000_sup_5 period1 ///
period2 period3 period4 ///
period5 period6 period6 period8 period9

*Column 2: adding oil
xtregar polity polity_5 logGDP_cap2000_sup_5 ///
logoil_gas_valuePOP_5 period1 ///
period2 period3 period4 ///
period5 period6 period6 period8 period9

*Column 3: 1960-80 only
xtregar polity polity_5  logGDP_cap2000_sup_5 ///
logoil_gas_valuePOP_5 ///
period1 period2 period3 period4 ///
period5 period6 period6 period8 period9 if year<1982

*Column 4: 1985-2004 only
xtregar polity polity_5  logGDP_cap2000_sup_5 ///
logoil_gas_valuePOP_5 ///
period1 period2 period3 period4 ///
period5 period6 period6 period8 period9 if year>1982

*Column 5: Adding Latin America*Oil
xtregar polity polity_5 logGDP_cap2000_sup_5 ///
logoil_gas_valuePOP_5 latin_logoil_5 period1 ///
period2 period3 period4 ///
period5 period6 period6 period8 period9

*Column 6: Further controls
xtregar polity polity_5 logGDP_cap2000_sup_5 ///
logoil_gas_valuePOP_5 latin_logoil_5 ///
dem_prior_update gdpgrowth_alt_new_5 mus_pct_sup period1 ///
period2 period3 period4 ///
period5 period6 period6 period8 period9

*Column 7: fixed effects
xtregar polity logGDP_cap2000_sup_5 ///
logoil_gas_valuePOP_5 latin_logoil_5 ///
period1 period2 period3 period4 ///
period5 period6 period6 period8 period9, fe


* Table 3.9

*Column 1: controls only
relogit auth_transition log_demyrs_1 ///
logGDP_cap2000_sup_1  ///
if democracy_up_1==1 & logoil_gas_valuePOP_1!=., cluster(id) 

*Column 2: adding Oil
relogit auth_transition log_demyrs_1 ///
logGDP_cap2000_sup_1  logoil_gas_valuePOP_1 ///
if democracy_up_1==1, cluster(id) 

*Column 3: Below $5000 only
relogit auth_transition log_demyrs_1 ///
logGDP_cap2000_sup_1 logoil_gas_valuePOP_1  ///
if GDP_cap2000_sup<5000 & democracy_up_1==1 , cluster(id) 

*Column 4: Above $5000 only
relogit auth_transition log_demyrs_1 ///
logGDP_cap2000_sup_1 logoil_gas_valuePOP_1 ///
if GDP_cap2000_sup>5000 & democracy_up_1==1 , cluster(id) 

*Column 5: 1960-79 only
relogit auth_transition log_demyrs_1 ///
logGDP_cap2000_sup_1 logoil_gas_valuePOP_1  ///
if year<1980 & democracy_up_1==1 , cluster(id) 

*Column 6: 1980-2006 only
relogit auth_transition log_demyrs_1 ///
logGDP_cap2000_sup_1 logoil_gas_valuePOP_1  ///
if year>1979 & democracy_up_1==1 , cluster(id) 

* Table 3.10 - Robustness

* *Column 1: Logit estimations of democratic transitions

*Row 1: Core model (from Table 3.7, *Column 5)
xtlogit dem_transition logGDP_cap2000_sup_1 ///
log_authyrs_1 logoil_gas_valuePOP_1 latin_logoil_1 YEAR1960_64 ///
YEAR1965_69 YEAR1970_74 YEAR1975_79 ///
YEAR1980_84 YEAR1985_89 YEAR1990_94 ///
YEAR1995_99 YEAR2000_04 YEAR2005_09, nolog

*Row 2: simple regime duration
xtlogit dem_transition logGDP_cap2000_sup_1 ///
authyrs_1 logoil_gas_valuePOP_1 latin_logoil_1 YEAR1960_64 ///
YEAR1965_69 YEAR1970_74 YEAR1975_79 ///
YEAR1980_84 YEAR1985_89 YEAR1990_94 ///
YEAR1995_99 YEAR2000_04 YEAR2005_09, nolog

*Row 3: regime duration squared
xtlogit dem_transition logGDP_cap2000_sup_1 ///
authyrs_sq_1 logoil_gas_valuePOP_1 latin_logoil_1 YEAR1960_64 ///
YEAR1965_69 YEAR1970_74 YEAR1975_79 ///
YEAR1980_84 YEAR1985_89 YEAR1990_94 ///
YEAR1995_99 YEAR2000_04 YEAR2005_09, nolog

*Row 4: dichotomous measure of oil income
xtlogit dem_transition logGDP_cap2000_sup_1 ///
authyrs_1 oil_gas_value100_1 latin_logoil_1 YEAR1960_64 ///
YEAR1965_69 YEAR1970_74 YEAR1975_79 ///
YEAR1980_84 YEAR1985_89 YEAR1990_94 ///
YEAR1995_99 YEAR2000_04 YEAR2005_09, nolog

*Row 5: all Persian Gulf countries dropped
xtlogit dem_transition logGDP_cap2000_sup_1 ///
authyrs_1 logoil_gas_valuePOP_1 latin_logoil_1 YEAR1960_64 ///
YEAR1965_69 YEAR1970_74 YEAR1975_79 ///
YEAR1980_84 YEAR1985_89 YEAR1990_94 ///
YEAR1995_99 YEAR2000_04 YEAR2005_09 if gulf==0, nolog

*Row 5: all Middle East countries dropped
xtlogit dem_transition logGDP_cap2000_sup_1 ///
authyrs_1 logoil_gas_valuePOP_1 latin_logoil_1 YEAR1960_64 ///
YEAR1965_69 YEAR1970_74 YEAR1975_79 ///
YEAR1980_84 YEAR1985_89 YEAR1990_94 ///
YEAR1995_99 YEAR2000_04 YEAR2005_09 if me_nafr==0, nolog

*Row 7: regional dummies
xtlogit dem_transition logGDP_cap2000_sup_1 ///
authyrs_1 logoil_gas_valuePOP_1 latin_logoil_1 YEAR1960_64 ///
YEAR1965_69 YEAR1970_74 YEAR1975_79 ///
YEAR1980_84 YEAR1985_89 YEAR1990_94 ///
YEAR1995_99 YEAR2000_04 YEAR2005_09 me_nafr ///
ssafrica latin asia oecd, nolog

* *Column 2: Democracy levels

*USING '5 year data for Polity OLS' in Ch 5

**Row 1: core model, from Table 3.8, *Column 5
xtregar polity polity_5 logGDP_cap2000_sup_5 ///
logoil_gas_valuePOP_5 latin_logoil_5 period1 ///
period2 period3 period4 ///
period5 period6 period6 period8 period9

**Row 4: drop Persian Gulf countries
xtregar polity polity_5 logGDP_cap2000_sup_5 ///
logoil_gas_valuePOP_5 latin_logoil_5 period1 ///
period2 period3 period4 ///
period5 period6 period6 period8 period9 if gulf==0

**Row 5: dichotomous measure of oil income
xtregar polity polity_5 logGDP_cap2000_sup_5 ///
oil_gas_value100_5 latin_logoil_5 period1 ///
period2 period3 period4 ///
period5 period6 period6 period8 period9

**Row 6: regional dummies
xtregar polity polity_5 logGDP_cap2000_sup_5 ///
logoil_gas_valuePOP_5 latin_logoil_5 period1 ///
period2 period3 period4 ///
period5 period6 period6 period8 period9 me_nafr ///
ssafrica latin asia oecd

* *Column 3: Transitions to authoritarianism

*Row 1: core model, from Table 3.9, *Column 6
relogit auth_transition log_demyrs_1 ///
logGDP_cap2000_sup_1  logoil_gas_valuePOP_1 ///
if democracy_up_1==1 & year>1979, cluster(id) 

*Row 2: simple regime duration
relogit auth_transition demyrs_1 ///
logGDP_cap2000_sup_1  logoil_gas_valuePOP_1 ///
if democracy_up_1==1 & year>1979, cluster(id) 

*Row 3: add regime squared
relogit auth_transition demyrs_sq_1 ///
logGDP_cap2000_sup_1  logoil_gas_valuePOP_1 ///
if democracy_up_1==1 & year>1979, cluster(id) 

*Row 4: dichotomous oil income
relogit auth_transition log_demyrs_1 ///
logGDP_cap2000_sup_1  oil_gas_value100_1 ///
if democracy_up_1==1 & year>1979, cluster(id) 

*Row 5: drop Congo, Ecuador, and Nigeria
relogit auth_transition log_demyrs_1 ///
logGDP_cap2000_sup_1  logoil_gas_valuePOP_1 ///
if democracy_up_1==1  & year>1979 & id!="COG" ///
& id!="ECU"& id!="NGA", cluster(id) 

*Row 6: drop Middle East
relogit auth_transition log_demyrs_1 ///
logGDP_cap2000_sup_1  logoil_gas_valuePOP_1 ///
if me_nafr==0 & ///
democracy_up_1==1 & year>1979, cluster(id) 

*Row 7: regional dummies
relogit auth_transition log_demyrs_1 ///
logGDP_cap2000_sup_1  logoil_gas_valuePOP_1 ///
ssafrica latin asia if ///
democracy_up_1==1 & year>1979, cluster(id) 


* Table 3.11

*Column 1: controls only
reg polity_2000_04 logGDP_cap2000_sup_2000_04 ///
logoil_gas_valuePOP_2000_04 ///
if govtconsump_revNEW_2000_04!=. & year==2004, robust

*Column 2: adding government spending-to-revenues
reg polity_2000_04 logGDP_cap2000_sup_2000_04 ///
logoil_gas_valuePOP_2000_04 ///
govtconsump_revNEW_2000_04 if year==2004, robust

*Column 3: controls only
reg polity logGDP_cap2000_sup ///
logoil_gas_valuePOP ///
if budget_open08rev_logoil!=. & year==2004, robust

*Column 4: adding oil*budget transparency
reg polity logGDP_cap2000_sup ///
logoil_gas_valuePOP ///
budget_open08rev_logoil if year==2004, robust

*Column 5: controls only
xtregar polity polity_1 logGDP_cap2000_sup_1 ///
logoil_gas_valuePOP_1 if press_logoil_rev_1!=.

*Column 6: adding oil*press freedom
xtregar polity polity_1 logGDP_cap2000_sup_1 ///
logoil_gas_valuePOP_1  press_logoil_rev_1 

* Table 4.1: Female Fraction of the Labor Force, 2002

ttest laborfemale if year==2002 & gdpcap2000_sup<5000, by (oil_gas_value100)
ttest laborfemale if year==2002 & gdpcap2000_sup>5000, by (oil_gas_value100)
ttest laborfemale if year==2002 & me_nafr>.5, by (oil_gas_value100)
ttest laborfemale if year==2002 & me_nafr<.5, by (oil_gas_value100)
ttest laborfemale if year==2002 & me_nafr<.5 & oecd<.5, by (oil_gas_value100)
ttest laborfemale if year==2002, by (oil_gas_value100)


* Table 4.2: Textile and Clothing Exports, 2002

ttest cloth_text2000_cap if year==2002 & gdpcap2000_sup<5000, by (oil_gas_value100)
ttest cloth_text2000_cap if year==2002 & gdpcap2000_sup>5000, by (oil_gas_value100)
ttest cloth_text2000_cap if year==2002, by (oil_gas_value100)

* Table 4.3: Parliamentary Seats, 2002

ttest female_seats if gdpcap2000_sup<5000 & year==2002, by (oil_gas_value100)
ttest female_seats if gdpcap2000_sup>5000 & year==2002, by (oil_gas_value100)
ttest female_seats if me_nafr>.5 & year==2002, by (oil_gas_value100)
ttest female_seats if me_nafr<.5 & year==2002, by (oil_gas_value100)
ttest female_seats if me_nafr<.5 & oecd<.5 & year==2002, by (oil_gas_value100)
ttest female_seats if year==2002, by (oil_gas_value100)

* Table 4.5 

*Column 1: just the controls
xtregar FDlaborfemale FDlogGDP_cap2000_sup_1 FDlogGDP_cap2000_supSQ_1 ///
FDage_1, fe

*Column 2: adding oil
xtregar FDlaborfemale FDlogGDP_cap2000_sup_1 FDlogGDP_cap2000_supSQ_1 ///
FDage_1 FDoil_gas_valuePOPred_1, fe

*Column 3: dropping fixed effects
xtregar FDlaborfemale FDlogGDP_cap2000_sup_1 FDlogGDP_cap2000_supSQ_1 ///
FDage_1 FDoil_gas_valuePOPred_1

*Column 4: replace AR(1) with year dummies
xtreg FDlaborfemale FDlogGDP_cap2000_sup_1 FDlogGDP_cap2000_supSQ_1 ///
FDage_1 FDoil_gas_valuePOPred_1 year1* year2*, fe

*Column 5: dropping SAU & KWT
xtregar FDlaborfemale FDlogGDP_cap2000_sup_1 FDlogGDP_cap2000_supSQ_1 ///
FDage_1 FDoil_gas_valuePOPred_1 if id!="KWT" & id!="SAU", fe

*Column 6: drop all Middle East & North Africa
xtregar FDlaborfemale FDlogGDP_cap2000_sup_1 FDlogGDP_cap2000_supSQ_1 ///
FDage_1 FDoil_gas_valuePOPred_1 if me_nafr==0, fe

*Column 7: Middle East only
xtregar FDlaborfemale FDlogGDP_cap2000_sup_1 FDlogGDP_cap2000_supSQ_1 ///
FDage_1 FDoil_gas_valuePOPred_1 if me_nafr==1, fe

*Column 8: using log of oil income
xtregar FDlaborfemale FDlogGDP_cap2000_sup_1 FDlogGDP_cap2000_supSQ_1 ///
FDage_1 FDlogoil_gas_valuePOP_1, fe

* TABLE 4.6

*Column 1: 1960-79 
xtregar FDlaborfemale FDlogGDP_cap2000_sup_1 FDlogGDP_cap2000_supSQ_1 ///
FDage_1 FDoil_gas_valuePOPred_1 if year<1980, fe

*Column 2: 1980-2002 
xtregar FDlaborfemale FDlogGDP_cap2000_sup_1 FDlogGDP_cap2000_supSQ_1 ///
FDage_1 FDoil_gas_valuePOPred_1 if year>1979, fe
 
*Column 3: 1960-79 Mideast only
xtregar FDlaborfemale FDlogGDP_cap2000_sup_1 FDlogGDP_cap2000_supSQ_1 ///
FDage_1 FDoil_gas_valuePOPred_1 if year<1980 & me_nafr==1, fe

*Column 4: 1980-2002, Mideast only
xtregar FDlaborfemale FDlogGDP_cap2000_sup_1 FDlogGDP_cap2000_supSQ_1 ///
FDage_1 FDoil_gas_valuePOPred_1 if year>1979 & me_nafr==1, fe

*Column 5: 1960-79, non-Mideast
xtregar FDlaborfemale FDlogGDP_cap2000_sup_1 FDlogGDP_cap2000_supSQ_1 ///
FDage_1 FDoil_gas_valuePOPred_1 if year<1980 & me_nafr==0, fe

*Column 5: 1980-2002, non-Mideast
xtregar FDlaborfemale FDlogGDP_cap2000_sup_1 FDlogGDP_cap2000_supSQ_1 ///
FDage_1 FDoil_gas_valuePOPred_1 if year>1979 & me_nafr==0, fe

* Table 4.7

***USING FEMALE SHORT DATA

*Column 1: controls only
reg laborfemaleMOD_2000 logGDPcap_2000 logGDPcap2 age, robust

*Column 2: adding oil
reg laborfemaleMOD_2000 logGDPcap_2000 logGDPcap2 age ///
oil_gas_valuePOPred, robust
 
*Column 3: other controls
reg laborfemaleMOD_2000 logGDPcap_2000 logGDPcap2  age ///
oil_gas_valuePOPred commie me_nafr islam_2000, robust

*Column 4
reg laborfemaleMOD_2000 logGDPcap_2000 logGDPcap2 age ///
oil_gas_valuePOPred commie me_nafr islam_2000 ///
oil_gas_valuePOPred_me, robust

* Table 4.8

*Column 1: controls only
reg female_seats_2000 logGDPcap_2000 me_nafr, robust

*Column 2: add oil
reg female_seats_2000 logGDPcap_2000 me_nafr oil_gas_valuePOPred, robust
*outreg2 using table.doc if year==2000, nolabel append

*Column 3: add islam_2000
reg female_seats_2000 logGDPcap_2000 me_nafr oil_gas_valuePOPred islam_2000, robust

*Column 4: add FLFP
reg female_seats_2000 logGDPcap_2000 me_nafr oil_gas_valuePOPred islam_2000 ///
laborfemaleMOD_2000, robust

*Column 5: add polity_2000
reg female_seats_2000 logGDPcap_2000 me_nafr oil_gas_valuePOPred islam_2000 ///
polity_2000, robust

*Column 6: add Proportional representation
reg female_seats_2000 logGDPcap_2000 me_nafr oil_gas_valuePOPred islam_2000 ///
polity_2000 PR_MOD, robust

* Table 4.9 - Robustness 

* First *Column: Female labor force participation

* *Row 1: Core model
reg laborfemaleMOD_2000 logGDPcap_2000 logGDPcap2 age ///
oil_gas_valuePOPred, robust

* *Row 2: dichotomous oil
reg laborfemaleMOD_2000 logGDPcap_2000 logGDPcap2 age ///
oil_gas_value100_2000, robust

* *Row 3: log of oil income
reg laborfemaleMOD_2000 logGDPcap_2000 logGDPcap2 age ///
logoil_gas_valuePOP_2000, robust

* *Row 4: Drop Kuwait and Qatar 
reg laborfemaleMOD_2000 logGDPcap_2000 logGDPcap2 age ///
oil_gas_valuePOPred if id!="KWT" & id!="QAT", robust

* *Row 5: Drop Middle East
reg laborfemaleMOD_2000 logGDPcap_2000 logGDPcap2 age ///
oil_gas_valuePOPred if  me_nafr==0, robust

* *Row 6: regional dummies
reg laborfemaleMOD_2000 logGDPcap_2000 logGDPcap2 age ///
oil_gas_valuePOPred latin ssafrica oecd asia, robust

* Second *Column: Female seats

* *Row 1: core model
reg female_seats_2000 logGDPcap_2000 me_nafr oil_gas_valuePOPred, robust

* *Row 2: dichotomous oil
reg female_seats_2000 logGDPcap_2000 me_nafr oil_gas_value100_2000, robust

* *Row 3: log of oil
reg female_seats_2000 logGDPcap_2000 me_nafr logoil_gas_valuePOP_2000, robust

* *Row 4: drop Kuwait and Qatar
reg female_seats_2000 logGDPcap_2000 me_nafr oil_gas_valuePOPred ///
if id!="KWT" & id!="QAT", robust

* *Row 5: drop all Middle East
reg female_seats_2000 logGDPcap_2000 me_nafr oil_gas_valuePOPred ///
if me_nafr==0, robust

* *Row 6: regional dummies
reg female_seats_2000 logGDPcap_2000 me_nafr oil_gas_valuePOPred ///
latin ssafrica oecd asia, robust

* Table 5.1

ttest dom_conflict_onset_2, by (oil_gas_value100)
ttest dom_conflict_onset_2  if gdpcap2000_sup<5000, by  (oil_gas_value100)
ttest dom_conflict_onset_2  if gdpcap2000_sup>5000, by  (oil_gas_value100)
ttest dom_conflict_onset_2  if year<1990, by  (oil_gas_value100)
ttest dom_conflict_onset_2  if year>1989, by  (oil_gas_value100)

* Table 5.4

* *Column 1: controls only
logit  dom_conflict_onset_2_dich logGDP_cap2000_sup_1  pop_log_1 ///
peaceyears _spline1 _spline2 _spline3, cluster(id)

* *Column 2: add oil
logit  dom_conflict_onset_2_dich  logGDP_cap2000_sup_1  pop_log_1 ///
logoil_gas_valuePOP_1 peaceyears _spline1 _spline2 _spline3, cluster(id)  

* *Column 3: below 5000 income
logit  dom_conflict_onset_2_dich  logGDP_cap2000_sup_1  pop_log_1 ///
logoil_gas_valuePOP_1 peaceyears _spline1 _spline2 _spline3 ///
if gdpcap2000_sup<5000, cluster(id)
 
* *Column 4: above-5000 income
logit  dom_conflict_onset_2_dich  logGDP_cap2000_sup_1  pop_log_1 ///
logoil_gas_valuePOP_1 peaceyears ///
_spline1 _spline2 _spline3  if gdpcap2000_sup>5000, cluster(id)

* *Column 5: oil*income interaction 
logit  dom_conflict_onset_2_dich  logGDP_cap2000_sup_1  pop_log_1 ///
logoil_gdpcap2000_sup_Q_1 ///
peaceyears _spline1 _spline2 _spline3, cluster(id)  

* Table 5.5

* *Column 1: 1960-89
logit  dom_conflict_onset_2_dich  logGDP_cap2000_sup_1  pop_log_1 ///
logoil_gas_valuePOP_1 ///
peaceyears _spline1 _spline2 _spline3 if year<1990, cluster(id)

* *Column 2: 1990-2006
logit  dom_conflict_onset_2_dich  logGDP_cap2000_sup_1  pop_log_1 ///
logoil_gas_valuePOP_1 ///
peaceyears _spline1 _spline2 _spline3 if year>1989, cluster(id)

* *Column 3: separatist conflicts only
logit  sep_conflict_onset_2_dich  logGDP_cap2000_sup_1  pop_log_1 ///
logoil_gas_valuePOP_1 ///
peaceyears _spline1 _spline2 _spline3, cluster(id)

* *Column 4: government conflicts only
logit  nat_conflict_onset_2  logGDP_cap2000_sup_1  pop_log_1 ///
logoil_gas_valuePOP_1 ///
peaceyears _spline1 _spline2 _spline3, cluster(id)

* *Column 5: Major conflicts only
logit  CW_onset_2_dich logGDP_cap2000_sup_1  pop_log_1 ///
logoil_gas_valuePOP_1 peaceyears _spline1 _spline2 _spline3, cluster(id)  

* *Column 6: Major conflicts, 1990-2006
logit  CW_onset_2_dich logGDP_cap2000_sup_1  pop_log_1 ///
logoil_gas_valuePOP_1 peaceyears _spline1 _spline2 _spline3 ///
if year>1989, cluster(id)  

* *Column 7: Offshore/onshore dummies
logit  dom_conflict_onset_2_dich  logGDP_cap2000_sup_1  pop_log_1 ///
oil_gas_value100_off_1 oil_gas_value100_on_1 ///
peaceyears _spline1 _spline2 _spline3, cluster(id)  

* Table 5.6 - Robustness

* First *Column: all states and periods 

* *Row 1: core model
logit  dom_conflict_onset_2_dich  logGDP_cap2000_sup_1  pop_log_1 ///
logoil_gas_valuePOP_1 peaceyears _spline1 _spline2 _spline3, cluster(id)  

* *Row 2: dichtomous oil
logit  dom_conflict_onset_2_dich  logGDP_cap2000_sup_1  pop_log_1 ///
oil_gas_value100_1 peaceyears _spline1 _spline2 _spline3, cluster(id)  

* *Row 3: drop Iran & Iraq
logit  dom_conflict_onset_2_dich  logGDP_cap2000_sup_1  pop_log_1 ///
logoil_gas_valuePOP_1 peaceyears _spline1 _spline2 _spline3 ///
if id!="IRN" & id!="IRQ", cluster(id)  

* *Row 4: drop Middle East
logit  dom_conflict_onset_2_dich  logGDP_cap2000_sup_1  pop_log_1 ///
logoil_gas_valuePOP_1 peaceyears _spline1 _spline2 _spline3 ///
if me_nafr==0, cluster(id)  

* *Row 5: regional dummies
logit  dom_conflict_onset_2_dich  logGDP_cap2000_sup_1  pop_log_1 ///
logoil_gas_valuePOP_1 peaceyears _spline1 _spline2 _spline3 ///
me_nafr ssafrica latin asia, cluster(id)  

* *Row 6: add Fearon-Laitin controls
logit  dom_conflict_onset_2_dich  logGDP_cap2000_sup_1  pop_log_1 ///
logoil_gas_valuePOP_1 polity_1 polity_sq_1 ef relfrac lmtnest ///
ncontig nwstate instab_new_1 peaceyears _spline1 _spline2 _spline3, cluster(id)  

* *Row 7: Fearon-Laitin civil wars
logit  onset_update logGDP_cap2000_sup_1  pop_log_1 ///
logoil_gas_valuePOP_1 peaceyears _spline1 _spline2 _spline3, cluster(id)  

* *Row 8: Sambanis civil wars 
logit warstnsb_update   logGDP_cap2000_sup_1  pop_log_1 ///
logoil_gas_valuePOP_1 peaceyears _spline1 _spline2 _spline3, cluster(id)  

* *Column 2: 1990-2006

* *Row 1: core model
logit  dom_conflict_onset_2_dich  logGDP_cap2000_sup_1  pop_log_1 ///
logoil_gas_valuePOP_1 peaceyears _spline1 _spline2 _spline3 if year>1989, cluster(id)  

* *Row 2: dichtomous oil
logit  dom_conflict_onset_2_dich  logGDP_cap2000_sup_1  pop_log_1 ///
oil_gas_value100_1 peaceyears _spline1 _spline2 _spline3 if year>1989, cluster(id)  

* *Row 3: drop Iran & Iraq
logit  dom_conflict_onset_2_dich  logGDP_cap2000_sup_1  pop_log_1 ///
logoil_gas_valuePOP_1 peaceyears _spline1 _spline2 _spline3 if year>1989 ///
& id!="IRN" & id!="IRQ", cluster(id)  

* *Row 4: drop Middle East
logit  dom_conflict_onset_2_dich  logGDP_cap2000_sup_1  pop_log_1 ///
logoil_gas_valuePOP_1 peaceyears _spline1 _spline2 _spline3 if year>1989 ///
& me_nafr==0, cluster(id)  

* *Row 5: regional dummies
logit  dom_conflict_onset_2_dich  logGDP_cap2000_sup_1  pop_log_1 ///
logoil_gas_valuePOP_1 peaceyears _spline1 _spline2 _spline3 ///
me_nafr ssafrica latin asia if year>1989, cluster(id)  

* *Row 6: add Fearon-Laitin controls
logit  dom_conflict_onset_2_dich  logGDP_cap2000_sup_1  pop_log_1 ///
logoil_gas_valuePOP_1 polity_1 polity_sq_1 ef relfrac lmtnest ///
ncontig nwstate instab_new_1 peaceyears _spline1 _spline2 _spline3 if year>1989, cluster(id)  

* *Row 7: Fearon-Laitin civil wars
logit  onset_update logGDP_cap2000_sup_1  pop_log_1 ///
logoil_gas_valuePOP_1 peaceyears _spline1 _spline2 _spline3 if year>1989, cluster(id)  

* *Row 8: Sambanis civil wars 
logit warstnsb_update   logGDP_cap2000_sup_1  pop_log_1 ///
logoil_gas_valuePOP_1 peaceyears _spline1 _spline2 _spline3 if year>1989, cluster(id)  

* *Column 3: Low-mid Income Countries only

* *Row 1: core model
logit  dom_conflict_onset_2_dich  logGDP_cap2000_sup_1  pop_log_1 ///
logoil_gas_valuePOP_1 peaceyears _spline1 _spline2 _spline3 if gdpcap2000_sup<5000, cluster(id)  

* *Row 2: dichtomous oil
logit  dom_conflict_onset_2_dich  logGDP_cap2000_sup_1  pop_log_1 ///
oil_gas_value100_1 peaceyears _spline1 _spline2 _spline3 if gdpcap2000_sup<5000, cluster(id)  

* *Row 3: drop Iran & Iraq
logit  dom_conflict_onset_2_dich  logGDP_cap2000_sup_1  pop_log_1 ///
logoil_gas_valuePOP_1 peaceyears _spline1 _spline2 _spline3 if gdpcap2000_sup<5000 ///
& id!="IRN" & id!="IRQ", cluster(id)  

* *Row 4: drop Iran & Iraq
logit  dom_conflict_onset_2_dich  logGDP_cap2000_sup_1  pop_log_1 ///
logoil_gas_valuePOP_1 peaceyears _spline1 _spline2 _spline3 if gdpcap2000_sup<5000 ///
& me_nafr==0, cluster(id)  

* *Row 5: regional dummies
logit  dom_conflict_onset_2_dich  logGDP_cap2000_sup_1  pop_log_1 ///
logoil_gas_valuePOP_1 peaceyears _spline1 _spline2 _spline3 ///
me_nafr ssafrica latin asia if gdpcap2000_sup<5000, cluster(id)  

* *Row 6: add Fearon-Laitin controls
logit  dom_conflict_onset_2_dich  logGDP_cap2000_sup_1  pop_log_1 ///
logoil_gas_valuePOP_1 polity_1 polity_sq_1 ef relfrac lmtnest ///
ncontig nwstate instab_new_1 peaceyears _spline1 _spline2 _spline3 if gdpcap2000_sup<5000, cluster(id)  

* *Row 7: Fearon-Laitin civil wars
logit  onset_update logGDP_cap2000_sup_1  pop_log_1 ///
logoil_gas_valuePOP_1 peaceyears _spline1 _spline2 _spline3 if gdpcap2000_sup<5000, cluster(id)  

* *Row 8: Sambanis civil wars 
logit warstnsb_update   logGDP_cap2000_sup_1  pop_log_1 ///
logoil_gas_valuePOP_1 peaceyears _spline1 _spline2 _spline3 if gdpcap2000_sup<5000, cluster(id)  

* Table 6.1: Changes in GDP per capita, 1960-2006

* All countries
ttest gdppc_growth_Maddison, by (oil_gas_value100)
ttest gdppc_growth_Maddison  if year<1974, by  (oil_gas_value100)
ttest gdppc_growth_Maddison  if year>1973 & year<1990, by  (oil_gas_value100)
ttest gdppc_growth_Maddison  if year>1989, by  (oil_gas_value100)

* LDCs only
ttest gdppc_growth_Maddison if LDCs>0, by (oil_gas_value100)
ttest gdppc_growth_Maddison if LDCs>0 & year<1974, by  (oil_gas_value100)
ttest gdppc_growth_Maddison if LDCs>0 & year>1973 & year<1990, by  (oil_gas_value100)
ttest gdppc_growth_Maddison if LDCs>0 & year>1989, by  (oil_gas_value100)

* Table 6.3: Changes in Total GDP, 1960-2006
* All countries
ttest gdp_growth_Maddison, by (oil_gas_value100)
ttest gdp_growth_Maddison  if year<1974, by  (oil_gas_value100)
ttest gdp_growth_Maddison  if year>1973 & year<1990, by  (oil_gas_value100)
ttest gdp_growth_Maddison  if year>1989, by  (oil_gas_value100)

* LDCs only
ttest gdp_growth_Maddison if LDCs>0, by (oil_gas_value100)
ttest gdp_growth_Maddison if LDCs>0 & year<1974, by  (oil_gas_value100)
ttest gdp_growth_Maddison if LDCs>0 & year>1973 & year<1990, by  (oil_gas_value100)
ttest gdp_growth_Maddison if LDCs>0 & year>1989, by  (oil_gas_value100)

* Table 6.4: Perceived government quality
ttest goveffect if year==2006, by (oil_gas_value100)
ttest corrupt if year==2006, by (oil_gas_value100)
ttest goveffect96_06 if year==2006, by (oil_gas_value100)
ttest corrupt96_06 if year==2006, by (oil_gas_value100)


